/*
 * ErrorSystemCall.cpp
 *
 *  Created on: Nov 3, 2013
 *      Author: vladimir
 */

#include "ErrorSystemCall.hpp"

#include <sstream>
#include <cstring>

namespace btexc
{

namespace
{

inline std::string AppendSystemCallErrorMessage( const std::string & txt,
                                                 const int errorNumber )
{
	std::stringstream ss;
	ss << txt << " errno(" << errorNumber << ") strerror(" << strerror( errorNumber ) << ")";
	return ss.str();
}

}

ErrorSystemCall::ErrorSystemCall( const std::string& errorMsg,
                                  const unsigned int errorNumber ) :
				ErrorBase( AppendSystemCallErrorMessage( errorMsg, errorNumber ) )
{
}

} /* namespace btexc */

